﻿<?php
class Form_AddJswjggtzd extends Zend_Form
{
	
	public function __construct($options = null)
	{
		parent::__construct($options);
		
		$this->setName('add_jswjggtzd')
		     ->setAttrib('enctype','multipart/form-data')
			 ->setMethod('post')
			 ->addElementPrefixPath('My_Decorator','My/Decorator','decorator')
			 ->setDecorators(array(
				'FormElements',array('HtmlTag',array('tag'=>'fieldset')),'Form'
			 ));
			 
		
		$old_id = new Zend_Form_Element_Text('old_id');
		$old_id->setLabel('序号')
			   ->setRequired(true)
			   ->addFilter('StripTags')
			   ->addFilter('StringTrim')
			   ->addValidator('NotEmpty')
			   ;
		$drawing_num = new Zend_Form_Element_Text('drawing_num');
		$drawing_num->setLabel('编号')
				    ->setRequired(true)
			        ->addFilter('StripTags')
			        ->addFilter('StringTrim')
			        ->addValidator('NotEmpty');
					//->setDecorators(array('Element'));
					
		$file_name = new Zend_Form_Element_Text('file_name');
		$file_name->setLabel('图号名称')
				  ;
				  
		$file_content = new Zend_Form_Element_Textarea('file_content');
		$file_content->setLabel('更改摘要')
		             ->setAttribs(array(
					 'required'=>true,
					 'style'=>'width:300px;height:200px'))
					 ;
					 
		$use_for = new Zend_Form_Element_Text('use_for');
		$use_for->setLabel('适用范围')
				;
				
		$add_date = new Zend_Form_Element_Text('add_date');
		$add_date->setLabel('生效日期')
				;
				 
		$scan_img = new Zend_Form_Element_File('scan_img');
		$scan_img->setLabel('扫描图片')
		         ->setDestination('D:/dms/public/doc/jswjggtzd')
				 ->addValidator('Count',false,1)
				 ->addValidator('Size',false,10240000)
				 ->addValidator('Extension',false,'jpg,png,gif');
		$pdf_file = new Zend_Form_Element_File('pdf_file');
		$pdf_file->setLabel('PDF电子版')
		         ->setDestination('D:/dms/public/doc/jswjggtzd')
				 ->addValidator('Count',false,1)
				 ->addValidator('Size',false,10240000)
				 ->addValidator('Extension',false,'pdf');		 
		$submit = new Zend_Form_Element_Submit('submit');
		
		$this->addElements(array($old_id,$drawing_num,$file_name,$file_content,$use_for,$add_date,$scan_img,$pdf_file,$submit));
	}
}